package com.example.controller;

import com.example.common.enums.ResponseCodeEnum;
import com.example.common.utils.ApiResult;
import com.example.model.entity.SuppliesRealinfoWarning;
import com.example.model.query.SuppliesRealinfoQuery;
import com.example.model.query.SuppliesRealinfoWarningQuery;
import com.example.service.SuppliesRealinfoService;
import com.example.service.SuppliesRealinfoWarningService;
import io.swagger.annotations.Api;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * SuppliesRealinfo Controller
 * 2020-08-27 18:59
 */
@Controller
@RestController
@RequestMapping("/suppliesRealinfoWarning")
@CrossOrigin
@Api(value = "告警信息管理",tags={"告警信息管理接口"})
public class SuppliesRealinfoWarningController {


	@Autowired
	private SuppliesRealinfoWarningService WarningService;

	/**
	 * 分页查询列表
	 */
	@GetMapping("/page")
	public ApiResult<SuppliesRealinfoWarningQuery> pageByQuery(SuppliesRealinfoWarningQuery query) {
		try {
			return WarningService.pageUserVoByQuery(query);
		}   catch (Exception e) {
			e.printStackTrace();
			return new ApiResult<>(ResponseCodeEnum.MALL_SERVICE_PAGE_AD_FALSE);
		}
	}
	
}
